package com.click.app.model.storage;

<%-- 
    Document   : purchaseDetailList
    Created on : 08/04/2009, 08:56:54 AM
    Author     : Joel Chuca
--%>

<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="purchaseDetailList.title"/></title>
    <meta name="heading" content="<fmt:message key='purchaseDetailList.heading'/>"/>
    <meta name="menu" content="RolePurchaser"/>
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helpPurchaseDetailList.html?decorate=false'/>"
           title="Ayuda Listado Detalles de Compra"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
            <fmt:message key="help"/>
        </a>
    </h2>
</div>

<table class="tableGrey" border="0">
    <tbody>
        <tr>
            <td><s:textfield key="purchase.supplier.fullName" required="true" cssClass="text medium" disabled="true"  maxLength="20"/></td>
            <td><s:textfield key="purchase.date" required="true" cssClass="text medium" disabled="true"  /></td>
            <td><s:textfield key="purchase.coin.name" required="true" cssClass="text medium" disabled="true"  /></td>
        </tr>
    </tbody>
</table>
<table class="tableGrey" border="0">
    <tbody>
        <tr>
            <td><s:textfield key="purchase.totalPrice" required="true" disabled="true"  /></td>
            <td><s:textfield key="purchase.discount" required="true" disabled="true"  /></td>
            <td><s:textfield key="purchase.discountXfail" required="true" disabled="true"  /></td>
            <td><s:textfield key="purchase.realPrice" required="true" disabled="true"  /></td>
        </tr>
    </tbody>
</table>

<c:set var="buttons">
    <c:if test="${ purchase.deleted }">
        <input type="button" style="margin-right: 5px" onclick="location.href='<c:url value="/editPurchaseDetail.html"/>'"
               value="<fmt:message key="button.add"/>" />
    </c:if>
    <c:if test="${ !purchase.deleted }">
        <input type="button" style="margin-right: 5px" onclick="location.href='<c:url value="/editPurchaseDetail.html"/>'"
               value="<fmt:message key="button.add"/>" disabled="true"/>
    </c:if>
    <input type="button" onclick="location.href='<c:url value="/finalizePurchaseDetail.html"/>'"
           value="<fmt:message key="button.done"/>"/>
    <input type="button" onclick="location.href='<c:url value="/generateJasperReport.html"/>'"
           value="<fmt:message key="button.reportPDF"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false" />

<s:set name="purchaseDetails" value="purchaseDetails" scope="request"/>
<br><br>
<display:table name="purchaseDetails"  class="table" export="true" requestURI="" pagesize="25"
               list="purchaseDetails_1" id="purchaseDetails_1" >
    
        <display:column titleKey="purchaseDetail" href="editPurchaseDetail.html" paramId="id" paramProperty="id">
            <c:if test="${purchaseDetails_1.deleted }">
                <fmt:message key="purchaseDetail.edit"/>
            </c:if>
            <c:if test="${!purchaseDetails_1.deleted }">
                <img src="<c:url value="/images/alert.gif" />" alt="Alert" />
            </c:if>
        </display:column>

    <display:column property="material.name" sortable="true" titleKey="material"/>
    <display:column property="material.description" sortable="true" titleKey="material.description"/>
    <display:column property="material.unitMeasure.name" sortable="true" titleKey="purchaseDetail.material.unitMeasure"/>
    <display:column property="quantity" sortable="true" titleKey="purchaseDetail.quantity"/>
    <display:column property="unitPrice" sortable="true" titleKey="purchaseDetail.unitPrice"/>
    <display:column property="discountXfail" sortable="true" titleKey="purchaseDetail.discountXfail"/>
    <display:column property="totalPrice" sortable="true" titleKey="purchaseDetail.totalPrice"/>
    <display:column titleKey="packageDetail" href="packageDetails.html" paramId="idPurchaseDetail" paramProperty="id">
        <fmt:message key="packageDetails.edit"/>
    </display:column>

    <display:setProperty name="paging.banner.item_name" value="purchase detail"/>
    <display:setProperty name="paging.banner.items_name" value="purchase details"/>

    <display:setProperty name="export.excel.filename" value="PurchaseDetail List.xls"/>
    <display:setProperty name="export.csv.filename" value="PurchaseDetail List.csv"/>
    <display:setProperty name="export.pdf.filename" value="PurchaseDetail List.pdf"/>
    <display:setProperty name="paging.banner.some_items_found" value=""/>
    <display:setProperty name="paging.banner.all_items_found" value=""/>
</display:table>

<c:out value="${buttons}" escapeXml="false" />

<script type="text/javascript">
    //highlightTableRows("purchaseDetailForm");
</script>